package com.sptus.util;

public interface SetParamStrategy {
    public String doSetParameter(String value);



    //Work mode setting 工作模式设置
    public class WorkMode implements SetParamStrategy {


        @Override
        public String doSetParameter( String value) {

            return value;
        }
    }
    //LCD hibernation wait time LCD休眠等待时间
    public class LCDHibernation implements SetParamStrategy {

        @Override
        public String doSetParameter( String value) {
            value="^S006LST"+value;
            return value;
        }
    }


    public class LSTMode implements SetParamStrategy {
        @Override
        public String doSetParameter( String value) {
            //^P004LST<cr>: Query LCD sleep wait time
            value="^S006LST"+value;
            return value;
        }
    }
    public class BVUMode implements SetParamStrategy {
        @Override
        public String doSetParameter( String value) {
            value="^S025BATDV"+value;
            return value;
        }
    }

    public class BZMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            String s = value.equals("0") ? "D" : "E";
            value="^S004P"+s+"A";
            return value;
        }
    }

    public class ECTSMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            value="^S007ECTS"+value;
            return value;
        }
    }

    public class RAPIDENMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            String s = value.equals("0") ? "D" : "E";
            value="^S004P"+s+"X";
            return value;
        }
    }

    public class RLENMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            value="^S005PBT"+value;
            return value;
        }
    }

    public class TSLMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            value="^S014ACLT"+value;
            return value;
        }
    }

    public class OPANGMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            value="^S007OPANG"+value;
            return value;
        }
    }

    public class SPMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            value="^S006SEP"+value;
            return value;
        }
    }

    public class PVPMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S006SPVP"+value;
        }
    }

    public class MCGMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S011MUCHGC"+value;
        }
    }

    public class TS1Mode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            return "^S024ACCT"+value;
        }
    }

    public class TMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S016DAT"+value+"00";
        }
    }

    public class OTAMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            String[] split = value.split(",");
            String sha256 = SHA256Util.getSHA256(split[1]);
            return split[0]+","+sha256;
        }
    }



    public class UFMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S003PF";
        }
    }

    public class MDMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            //^S006DMnnn<cr>: Set machine model
            return "^S006DM"+value;
        }
    }

    public class FEMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
//            String s = value.equals("0") ? "D" : "E";//
            return "^S005EDC"+value;
        }
    }

    public class BFE1Mode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
//            String s = value.equals("0") ? "D" : "E";
            return "^S005EDF"+value;
        }
    }

    public class BFE2Mode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
//            String s = value.equals("0") ? "D" : "E";
            return "^S005EDG"+value;
        }
    }

    public class OVMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S006V"+value;
        }
    }

    public class FOMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S004F"+value;
        }
    }

    public class MOMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
//            String s = value.equals("0") ? "D" : "E";
            return "^S006PALE"+value;
        }
    }

    public class PDE2Mode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S005EDD"+value;
        }
    }

    public class PDE1Mode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S005EDE"+value;
        }
    }

    public class BTMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S005PBT"+value;
        }
    }

    public class MCCMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S010MCHGC"+value;
        }
    }

    public class MDHMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            return "^S009BDCM"+value;
        }
    }

    public class PCEMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            if(value.equals("0")){
                return "^S005EDA1:^S005EDB1";
            }else if(value.equals("1")){
                return "^S005EDA1:^S005EDB0";
            }else {
                return "^S005EDA0:^S005EDB0";
            }
        }
    }

    public class BBAMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            return "^S004BT"+value;
        }
    }

    public class GENPMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            if(value.equals("0")){
                return "^S004PDS";
            }else if(value.equals("2")){
                return "^S004PEW";
            }else {
                return "^S004PEP";
            }
        }
    }

    public class VOMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S006V"+value;
        }
    }

    public class OMMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            return "^S006PALE"+value;
        }
    }

    public class GGIMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            String s = value.equals("0") ? "D" : "E";
            return "^S004P"+s+"E";
        }
    }

    public class WGIMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            String s = value.equals("0") ? "D" : "E";
            return "^S004P"+s+"E";
        }
    }

    public class BSOC1Mode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S021BATDS"+value;
        }
    }

    public class BVFMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {
            return "^S015MCHGV"+value;
        }
    }

    public class LOGMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            return "^S005LON"+value;
        }
    }

    public class BVMMode implements SetParamStrategy {
        @Override
        public String doSetParameter(String value) {

            return "^S015MCHGV"+value;
        }
    }
}
